package my.edu.model.bills.sales.service;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import my.edu.common.domain.PageDTO;
import my.edu.common.domain.PageVO;
import my.edu.common.myInterface.GetOne;
import my.edu.model.bills.sales.entity.SalesOrder;
import my.edu.model.bills.sales.entity.SalesReturnOrder;
import my.edu.model.bills.sales.entity.dto.SalesDTO;
import my.edu.model.bills.sales.entity.dto.SalesOrderSearchDTO;
import my.edu.model.bills.sales.entity.dto.SalesReturnDTO;
import my.edu.model.bills.sales.entity.vo.SalesVO;

import java.math.BigDecimal;
import java.time.Month;
import java.time.YearMonth;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface ISalesOrderService extends IService<SalesOrder>, GetOne {
    void saveNew(SalesDTO salesDTO, String status);

    void removeOrder(List<Long> ids);

    void updateOrder(SalesDTO salesDTO, String status);

    void auditOrder(List<Long> ids);

    void rauditOrder(List<Long> ids);

    PageVO<SalesVO> getSalesOrderList(PageDTO page, SalesOrderSearchDTO salesOrderSearchDTO);

    SalesVO getSalesOrderOne(Long id);

    List<SalesVO> listOnly(SalesOrderSearchDTO salesOrderSearchDTO);

    Map<String,Object> checkSalesOrderAndSetCache(SalesReturnDTO salesReturnDTO);

    void updateReturnId(SalesReturnOrder salesReturnOrder,String returnStatus);
    void updateReturnId(Long id ,SalesReturnOrder salesReturnOrder,String returnStatus);

    void removeReturn(List<Long> ids);

    BigDecimal getTodaySale();

    BigDecimal getMonthSale();

    BigDecimal getYesterdaySale();

    BigDecimal getYearSale();

    Map<YearMonth, BigDecimal> getSalePriceList();

    JSONObject getReportList(PageDTO pageDTO, SalesOrderSearchDTO salesOrderSearchDTO);
}
